/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

import OrderItem from './OrderItem';

@Serializable()
export class OrderQuery {
  @JsonProperty('showPicker')
    showPicker: boolean = false;

  @JsonProperty('pageNum')
    pageNum: number = 1;

  @JsonProperty('pageSize')
    pageSize: number = 30;

  @JsonProperty('orderNo')
    orderNo: string = '';

  @JsonProperty('status')
    status: number = 0;

  @JsonProperty('realName')
    realName: string = '';

  get params() {
    return {
      pageNum: this.pageNum,
      pageSize: this.pageSize,
      orderNo: this.orderNo,
      status: this.status,
      realName: this.realName,
    };
  }
}

@Serializable()
export default class OrderList {
  @JsonProperty({ name: 'rows', type: OrderItem })
    items: OrderItem[] = [];

  @JsonProperty('total')
    total: number = 0;
}
